import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/system/sysUser/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/system/sysUser/info',
    method: 'get',
    params: { token }
  })
}

/**
 * 注册
 */
export function signup(sysUser){
  return request({
    url: '/system/sysUser/signup',
    method: 'post',
    data: sysUser
  })
}

/**
 * 获取验证码
 */
export function sendCode(email){
  return request({
    url: `/system/sysUser/sendCode/${email}`,
    method: 'get'
  })
}
export function codeLogin(data){
  return request({
    url: '/system/sysUser/code/login',
    method: `post`,
    data: data
  })
}

/**
 * 登出
 */
export function logout() {
  return request({
    url: '/system/sysUser/logout',
    method: 'post'
  })
}
